package provider

import (
	"context"
	"io"
	"time"

	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
)

type Provider interface {
	// GetName 获取供应商名称
	GetName() string

	// GetBucket 获取存储桶
	GetBucket() string

	// PutObject 上传文件
	PutObject(ctx context.Context, filepath string, size int64, reader io.Reader) errors.Error

	// GetObject 获取文件
	GetObject(ctx context.Context, filepath string) (io.ReadCloser, errors.Error)

	// GetObjectHash 获取文件哈希值
	GetObjectHash(ctx context.Context, filepath string) (string, string, string, errors.Error)

	// DeleteObject 删除文件
	DeleteObject(ctx context.Context, filepath string) errors.Error

	// GetObjectAccessedUrl 获取文件访问URL
	GetObjectAccessedUrl(ctx context.Context, filepath string, timeout time.Duration) (string, errors.Error)
}
